import service from '@/server/index.js'

// 分页查询${table.comment!'记录'}
export const getPage = (params = {}) => {
  return service({
    url: "/${entity?uncap_first}/page",
    method: "GET",
    params: params,
    setting: {
      isToken: true,
      json: false,
    }
  });
};

// 新增${table.comment!'记录'}
export const add = (params = {}) => {
  return service({
    url: "/${entity?uncap_first}",
    method: "POST",
    data: params,
    setting: {
      isToken: true,
      json: true,
    }
  });
};

// 修改${table.comment!'记录'}
export const update = (params = {}) => {
  return service({
    url: "/${entity?uncap_first}",
    method: "PUT",
    data: params,
    setting: {
      isToken: true,
      json: true,
    }
  });
};

// 删除${table.comment!'记录'}
export const del = (id) => {
  return service({
    url: "/${entity?uncap_first}/" + id,
    method: "DELETE",
    setting: {
      isToken: true,
      json: false,
    }
  });
};

// 根据ID查询${table.comment!'记录'}
export const getById = (id) => {
  return service({
    url: "/${entity?uncap_first}/" + id,
    method: "GET",
    setting: {
      isToken: true,
      json: false,
    }
  });
};
